﻿@model PrjAssessModels.BaseModels.Project

@{
    ViewBag.Title = "Index";
}
@section scripts{
    <script type="text/ecmascript" src="@Url.Content("~/Scripts/chartJs.js")"></script>
    <script type="text/javascript">
       
        $(function ()
        {
            var json = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(this.Model))';
            var model = JSON.parse(json);
            ChartCreator.createChart(model);
            $("#MertirialTab").ejTab();
            $("#WorkTab").ejTab();
            $("#SumTab").ejTab();
            $('#EditMertirial,#EditWork').click(function (event)
            {
                event.preventDefault();
                var targetUrl = this.href;
                var url = '@Url.Action("SaveAssess","ReadAssess")';
                $.post(url, { 'prjJson': json },
                    function (data)
                    {
                        if (data = 1)
                        {
                            document.location.href = targetUrl;
                        }
                        else
                        {
                            alert('Err!');

                        }
                });//end post
            });
            
        });

    </script>
}
<div class="container">
    <br />
    <!-- 考核的基本信息-->
    <ul class="list-inline">
        <li>
            <h4>
                <strong><span>1.项目基本信息</span></strong>
            </h4>
        </li>
        <li>
            <h6><a href="@Url.Action("EditBasicInfo","DoAssess")">修改</a></h6>
        </li>
    </ul>
    
    <br />
    <table class="table table-bordered">
        <thead>
            <!-- background-image:linear-gradient(rgb(251, 81, 84) 0%, rgb(234, 70, 73) 80%);-->
            <tr style="background-color: rgb(27, 149, 207); color: #fff;">
                <td><span>工程编号</span></td>
                <td><span>工程地址</span></td>
                <td><span>监测类型</span></td>
                <td><span>班组长</span></td>
                <td><span>项目经理</span></td>
                <td><span>工期</span></td>
                <td><span>采购厂商</span></td>
                <td><span>工作量系数</span></td>
                <td><span>综合系数</span></td>
                <td><span>采购系数</span></td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>@Model.PrjId</td>
                <td>@Model.Address</td>
                <td>@Model.MonitorType</td>
                <td>@Model.Leader</td>
                <td>@Model.Manager</td>
                <td>@Model.ConstructionPeriod.ToString()</td>
                <td>@Model.Manufacture</td>
                <td>@Model.PrjExtent.WorkRatio</td>
                <td>@Model.PrjExtent.PrjRatio</td>
                <td>@Model.PrjExtent.MaterialPurchaseRatio</td>
            </tr>
        </tbody>
    </table>

   
    <!-- 材料埋设详单-->
    <br />
    <ul class="list-inline">
        <li>
            <h4>
                <strong><span>2.材料埋设详单</span></strong>
            </h4>
        </li>
        <li>
            <h6><a id="EditMertirial" href="@Url.Action("DisplayMertialBury", "ReadAssess")">修改</a></h6>
        </li>
    </ul>
    <br />
    <div id="MertirialTab">
        <ul>
            <li><a href="#MertirialTable">材料埋设表单</a></li>
            <li><a href="#chartMertirial">材料埋设图示</a></li>
        </ul>
         <div id="MertirialTable">
            <table class="table table-bordered">
                <thead>
                    <!-- style="background-color:#dd7b71; color: #fff;"-->
                    <tr style="background-color: rgb(230, 230, 230);">

                        <td><strong>分项内容</strong></td>
                        <td><strong>规格方法</strong></td>
                        <td><strong>数量</strong></td>
                        <td><strong>材料单价</strong></td>
                        <td><strong>埋设单价</strong></td>
                        <td><strong>总计</strong></td>
                        <td><strong>参数</strong></td>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var contentItem in Model.ContentGroup)
                    {
                        for (int i = 0; i < contentItem.Count; i++)
                        {
                        <tr>
                            @if (i == 0)
                            {
                                <td rowspan="@contentItem.Count" style="vertical-align:central;">@contentItem.ContentName</td>  
                                    }
                            <td>@contentItem.Items[i].Method</td>
                            <td>@contentItem.Items[i].Number</td>
                            <td>@contentItem.Items[i].MaterialPrice</td>
                            <td>@contentItem.Items[i].BuryPrice</td>
                            @if (i == 0)
                            {
                                <td rowspan="@contentItem.Count">@contentItem.Sum</td> 
                                    }
                            @if (@contentItem.Items[i].Para != 0)
                            {
                                <td>@contentItem.Items[i].Para</td>   
                                    }
                            else
                            {
                                <td></td>   
                                    }
                        </tr>
                                
                                }
                            }
                </tbody>
            </table>
        </div>
        <div id="chartMertirial">
        </div>
        <!--style="min-height:400px;" -->
       
    </div>	

    <br />
        <ul class="list-inline">
        <li>
            <h4>
                <strong><span>3.考核工作量详单</span></strong>
            </h4>
        </li>
        <li>
            <h6><a id="EditWork" href="@Url.Action("DisplayWorks", "ReadAssess")">修改</a></h6>
        </li>
    </ul>
    <br /> 
      <div id="WorkTab">
                <ul>
                    <li><a href="#WorkTable">核算工作量表单</a></li>
                    <li><a href="#chartWork">核算工作量图示</a></li>
                    
                </ul>
            <div id="WorkTable" >
                    <table class="table table-bordered">
                        <thead>
                            <!-- style="background-color:#dd7b71; color: #fff;"-->
                            <tr style="background-color:rgb(230, 230, 230);">

                                <td><strong>分项内容</strong></td>
                                <td><strong>数量</strong></td>
                                <td><strong>单价</strong></td>
                                <td><strong>预估次数</strong></td>
                                <td><strong>费用</strong></td>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model.Works)
                            {
                                <tr>
                                    <td>@item.ContentName</td>
                                    <td>@item.Number</td>
                                    <td>@item.Price</td>
                                    <td>@item.PredictNo</td>
                                    <td>@item.Sum</td>
                                </tr>
                                
                               
                            }
                        </tbody>
                    </table>
                </div>
                <div id="chartWork">
                </div>
                <!--style="min-height:400px;" -->
              
            </div>

     <!-- 考核的饼状图-->
    <br />

    <h4><strong>4.考核总览图</strong></h4>
       <br />
    <div id="SumTab">
        <ul>
            <li><a href="#SumTable">核算工作量表单</a></li>
            <li><a href="#SumGraph">核算工作量图示</a></li>

        </ul>
        <div id="SumTable">
            <table class="table table-bordered">
                <thead>
                    <!-- background-image:linear-gradient(rgb(251, 81, 84) 0%, rgb(234, 70, 73) 80%);-->
                    <tr style="background-color:rgb(230, 230, 230);">
                        <td><span>合同额(100%)</span></td>
                        <td><span>材料埋设费用(@((Model.MaterialBurySum/Model.Contract).ToString("0%")))</span></td>
                        <td><span>核定工作量(@((Model.WorkSum/Model.Contract).ToString("0%")))</span></td>
                        <td><span>其他(@(((Model.Contract - Model.WorkSum - Model.MaterialBurySum)/Model.Contract).ToString("0%")))</span></td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>￥@Model.Contract</td>
                        <td>￥@Model.MaterialBurySum</td>
                        <td>￥@Model.WorkSum</td>
                        <td>￥@(Model.Contract - Model.WorkSum - Model.MaterialBurySum)</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div id="SumGraph">
            <div id="chart">
            </div>
        </div>
    </div>
</div>
